]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
build: Use internal dependencies
authorEmmanuele Bassi <ebassi@gnome.org>
Thu, 10 Aug 2017 22:30:42 +0000 (23:30 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Thu, 10 Aug 2017 22:30:42 +0000 (23:30 +0100)
We cannot rely on any build order, except the one we specify ourselves.

St depends on various generated files; other targets depend on those
files existing, so they can be included. There is no direct relationship
between targets and files, unless we declare a dependency, using the
Meson declare_dependency() constructor — which allows us to replace the
various `link_with` directives with the more appropriate `dependencies`
one, and also allows us to specify sources that must exist by the time
we build those targets.

src/meson.build
src/st/meson.build

index 6957a948ef14131c77d03e9b671aafeac3fe9522..5f1e0b01af7139a325e674fbd931033f79040004 100644 (file)
@@ -101,6 +101,7 @@ libshell_menu_gir = gnome.generate_gir(libshell_menu,
   install: true
 )
 
+libshell_menu_dep = declare_dependency(link_with: libshell_menu)
 
 libshell_public_headers = [
   'shell-app.h',
@@ -209,16 +210,18 @@ libshell_no_gir_sources += dbus_generated
 
 libshell = library('gnome-shell',
   sources: libshell_gir_sources + libshell_no_gir_sources,
-  dependencies: gnome_shell_deps + [mutter_dep, m_dep],
+  dependencies: gnome_shell_deps + [libshell_menu_dep, libst_dep, mutter_dep, m_dep],
   include_directories: [conf_inc, st_inc, include_directories('tray')],
   c_args: gnome_shell_cflags,
-  link_with: [libshell_menu, libst, libtray],
+  link_with: [libtray],
   link_args: rpath_link_args,
   install_rpath: install_rpath,
   install_dir: pkglibdir,
   install: true
 )
 
+libshell_dep = declare_dependency(link_with: libshell)
+
 libshell_gir_includes = [
   'Clutter-@0@'.format(mutter_api_version),
   'ClutterX11-@0@'.format(mutter_api_version),
@@ -241,7 +244,6 @@ gnome.generate_gir(libshell,
   nsversion: '0.1',
   namespace: 'Shell',
   includes: libshell_gir_includes,
-  link_with: [libshell_menu, libst],
   extra_args: ['--quiet'],
   install_dir_gir: pkgdatadir,
   install_dir_typelib: pkglibdir,
@@ -252,8 +254,7 @@ executable('gnome-shell', 'main.c',
   c_args: gnome_shell_cflags + [
     '-DMUTTER_TYPELIB_DIR="@0@"'.format(mutter_typelibdir)
   ],
-  dependencies: gnome_shell_deps + [mutter_dep],
-  link_with: libshell,
+  dependencies: gnome_shell_deps + [libshell_dep, mutter_dep],
   include_directories: [conf_inc, st_inc, include_directories('tray')],
   link_args: rpath_link_args,
   install_rpath: install_rpath,
index 02064bd9ed5febe1abfa2f3e1f0475ab825a4cc8..ab5526c50501ab28253bf0d2a6a015792b339e17 100644 (file)
@@ -127,6 +127,10 @@ libst = shared_library('st-1.0',
   install: true
 )
 
+libst_dep = declare_dependency(link_with: libst,
+  sources: st_built_sources
+)
+
 test_theme = executable('test-theme',
   sources: 'test-theme.c',
   c_args: st_cflags,